import Measurement from "@arcgis/core/widgets/Measurement.js";
import { mapView } from "@/api/map";

let disMeasurement: Measurement, areaMeasurement: Measurement;
export const disMeasure = () => {
  // 测量距离工具
  disMeasurement = new Measurement({
    view: mapView,
    activeTool: "distance",
    icon: "measure-line",
  });
  mapView.ui.add(disMeasurement, "top-right");
};
export const areaMeasure = () => {
  //测量面积工具
  areaMeasurement = new Measurement({
    view: mapView,
    activeTool: "area",
    icon: "measure-area",
  });
  mapView.ui.add(areaMeasurement, "top-right");
};

export { disMeasurement, areaMeasurement };
